package com.yc.hotel.user.feign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.yc.hotel.dto.UserItemDTO;

@FeignClient(name="user-server", fallback = IUserItemFeignClient.UserItemFeignClientFallBack.class)
public interface IUserItemFeignClient {
	
	@GetMapping("/userItems/findByUno")
	List<UserItemDTO> findByUno(@RequestParam int uno);
	
	@PostMapping("/userItems/add")
	int add(@RequestBody UserItemDTO userItem,@RequestParam int uno);
	
	@Component
	public static class UserItemFeignClientFallBack implements IUserItemFeignClient {

		@Override
		public List<UserItemDTO> findByUno(int uno) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public int add(UserItemDTO userItem, int uno) {
			// TODO Auto-generated method stub
			return 0;
		}


	}
}
